/**
 * 书籍表
 */
 module.exports = function (sequelize, DataTypes,Model) {
    class BookModel extends Model {
    }
    BookModel.init({
        id: {
            type: DataTypes.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            comment:"主键"
        },
        image: {
            type: DataTypes.STRING,
            allowNull: true,
            comment:"书籍封面"
        },
        book_name: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "书籍名称",
        },
        author: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "书籍作者",
        },
        details: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "书籍简介",
        },
        lend_time: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "借阅天数",
        },
        phone: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "书籍发布人手机号码",
        },
        address: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "取货地址",
        },
        owner: {
            type: DataTypes.STRING,
            allowNull: true,
            comment: "书籍发布人",
        },
        enable: {
            type: DataTypes.BOOLEAN,
            allowNull: true,
            comment: "是否为可借状态",
        },
    }, {
        sequelize,
        modelName:"book"
    })
    return BookModel
}